package com.rule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.rule.DiyRule;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author chenyuan
 * @date 2020/9/30 12:19
 */
@Configuration
public class CustomizedRule {
    /**
     * 修改默认的负载均衡策略
     */
    @Bean
    public IRule customize(){
        // 先使用已经实现的策略——随机
        return new DiyRule();
    }
}
